package com.mystring.service.impl;

import com.mystring.config.SpringConfig;
import com.mystring.service.ProductService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
* ClassName: ProductServiceImplTest01
* Package: com.mystring.service.impl
* Description:
* @Author 刘英杰
* @Create 2025/1/31 21:17
* @Version 1.0
*/
@RunWith(SpringJUnit4ClassRunner.class)//将原来的Junit4测试框架替换为Spring的测试框架
@ContextConfiguration(classes = SpringConfig.class)//加载Spring配置类
public class ProductServiceImplTest01 {
    @Autowired
    private ProductService productService;

    @Test
    public void testFindAll() {
        productService.findAll().forEach(System.out::println);
    }
}